import React from "react";
import { View, Button, Text } from "@tarojs/components";

const Index = ({ count, onChange, min }) => {
  return (
    <View className="number-step">
      <Button className="btn-sub" disabled={ count <= min } size="mini" onClick={() => count > min && onChange(count - 1)}>
        -
      </Button>
      <Text>{count}</Text>
      <Button size="mini" onClick={() => onChange(count + 1)}>
        +
      </Button>
    </View>
  );
};

export default Index;
